package com.cw.controller;

import com.cw.service.StaffService;
import com.cw.utils.R;
import com.cw.vo.LoginVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: MySyetem
 * @description: 登录控制层
 * @author: 张庆恒
 * @create: 2021-08-27 20:19
 **/
@RestController
@RequestMapping("login")
public class LoginController {
    @Resource
    private StaffService staffService;
    @PostMapping
    public R login(@RequestBody LoginVo loginVo) {
        return staffService.getStaffByUP(loginVo.getUsername(), loginVo.getPassword());
    }
}
